package com.grasp.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class MySQLiteHelper extends SQLiteOpenHelper {

	private static final String DATABASE_NAME = "GRASP_SYSTEM.db"; // 数据库名称
	private static final int VERSION = 1; // 数据库版本
	private SQLiteInterface mSQLiteInterface;

	/**
	 * sa
	 * 
	 * @param context
	 */
	public MySQLiteHelper(Context context, SQLiteInterface mSQLiteInterface) {
		super(context, DATABASE_NAME, null, VERSION);
		this.mSQLiteInterface = mSQLiteInterface;
	}

	public MySQLiteHelper(Context context, String name, CursorFactory factory,
			int version) {
		super(context, name, factory, version);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		mSQLiteInterface.createTable(db);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		mSQLiteInterface.onUpgrade(oldVersion, newVersion);
	}

}
